import * as Router from 'koa-router';
import { Api } from '../../config/params';
import { ManageCtrl } from '../../controlers/user/manage.controller';
import { LoginCtrl } from '../../controlers/user/login.controller';
import { RegisterCtrl } from '../../controlers/user/register.controller';

const router = new Router();

router.prefix(`${Api}/user`);
/**
 * @api {get} /info 获取用户信息
 * @apiName info
 * @apiUse myInfo
 * @apiUse myInfoCtrl
 * @apiGroup Manage
 * @apiVersion 1.0.0
 */
router.post('/add', ManageCtrl.addUser);
router.delete('/delete', ManageCtrl.deleteUser);
router.post('/login', LoginCtrl.index);
router.post('/reg', RegisterCtrl.index);

export default router;
